#ifndef __Entity_H__ 
#define __Entity_H__ 

#include "cocos2d.h" 
#include "Tank.h"
#include "ControllerListener.h"
#include "FourDirectionMoveController.h"
USING_NS_CC; 


class Entity : public Node, public ControllerListener{ 
public:
	Entity();
	~Entity();

	void bindNode(Node* node);
	Node* getNode();
	void setController(Controller* controller);
	void setTiledMap(TMXTiledMap* map);

	virtual bool setTagPosition(float x, float y);
	virtual Vec2 getTagPosition();
	virtual float getTagRotation();
	virtual void setTagRotation(float rota);
	virtual Node* get_Parent();
	virtual Node* getThis();


	void setTankHead(float rotation);
	float getTankHead();
	

	virtual void getBox(float x, float y);

	void hurt(int hurtValue);
	bool isDead();
	bool isInRect(Rect rect);
	

protected:
	virtual void onDead();
	Vec2 a[8];

protected:
	TMXTiledMap* m_map;
	TMXLayer* meta;
	Node* m_node;
	int m_rotation;
	bool m_isDead;
	Controller* m_controller;
	
	/*
		Some Attri Here
	*/
	CC_SYNTHESIZE(int, m_HP, HP);
	CC_SYNTHESIZE(int, m_atk, Atk);
	CC_SYNTHESIZE(int, m_speed, Speed);
	CC_SYNTHESIZE(int, m_bullet, Bullet);
	CC_SYNTHESIZE(int, m_maxHP, MaxHP);
}; 


#endif // __Entity_H__ 
